import React, { Component } from 'react';
import './musicItem.css'
import axios from 'axios'

class MusicItem extends Component {
    // constructor(props) {
    //     super(props)
    //     this.state = {
    //         playlists: []
    //     }
    // }
    render() {
        const item = this.props.playlists.map(item => {
            return (
                <div className='content'>
                    <img src={item.coverImgUrl} alt="" />
                    <div>{item.name}</div>
                </div>
            )
        })
        return (
            <div className='container flex'>
                {item}
            </div>
        );
    }
    // componentDidMount() {
    //     axios
    //         .get(`http://122.112.161.135:3000/top/playlist?cat=华语`)
    //         .then(res => {
    //             this.setState({ playlists: res.data.playlists })
    //         })
    // }
}

export default MusicItem;
